<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
		 function fn(){
			 const A = [{
				 data:"2021-20-1",
				 price:120,
				 id:1
			 },{
				 data:"2022-52-5",
				 price:34,
				 id:2
			 }]
			 return Array.from(new Set(A.map((item) => item.data))).map((data) => ({
				 data,
				 list:A.filter((row) => row.data === data)
			 }))
		 }
		console.log( fn())
		</script>
	</body>
</html>
